﻿using Library.Common.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Library.Core.Infrastructure.PersistenceObject
{
    public abstract class PersistenceObjectBase
    {
        public PersistenceObjectBase()
        {
            this.Id = this.Id == Guid.Empty ? GuidHelper.GetSecuentialGuid() : this.Id;
            this.CreateTime = this.CreateTime == DateTime.MinValue ? DateTime.Now : this.CreateTime;
        }
        /// <summary>
        /// RowKey
        /// </summary>
        public Guid Id { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人ID
        /// </summary>
        public Guid CreateUserId { get; set; }

        /// <summary>
        /// 创建人账户（用于登录的账户名一般是不能修改的）
        /// </summary>
        public string CreateUserName { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
        /// <summary>
        /// 最后修改人ID
        /// </summary>
        public Guid? UpdateUserId { get; set; }

        /// <summary>
        /// 最后修改人账户（用于登录的账户名一般是不能修改的）
        /// </summary>
        public string UpdateUserName { get; set; }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 删除日期
        /// </summary>
        public DateTime? DelTime { get; set; }
        /// <summary>
        /// 操作人员Id
        /// </summary>
        public Guid? DelUserId { get; set; }
        /// <summary>
        /// 操作人员名字
        /// </summary>
        public string DelUserName { get; set; }

        ///// <summary>
        ///// 时间搓
        ///// </summary>
        //[Timestamp]
        //public string Timestamps { get; set; }

    }
}
